package ru.bragnikita.utils.swing.widget.form;

import javax.swing.*;

/**
 * @author Nikita.Brazhnikov
 */
public abstract class AbstractForm extends WidgetController{

	private JPanel formPanel;

	public AbstractForm(String id) {
		this(id, null);
	}

	public AbstractForm(String id, String name) {
		super(id);

		formPanel = new JPanel();
		if (name != null)
			formPanel.setBorder(BorderFactory.createTitledBorder(name));
		fillForm(formPanel);
	}

	public JPanel getFormPanel() {
		return formPanel;
	}

	protected abstract void fillForm(JPanel panel);

}
